<style>
	page{
		background: #fafafa;
	}
 
    .red {
        background: #ff413e;
    }

    

    .g-content-box {
        width: 100%;
        overflow: hidden;
		padding-bottom: 100upx;
    }

    .m-log {
        width: 90%;
        margin: 0 auto;
        height: 100%;
    }

    .m-log-list {
        width: 100%;
		position: relative;
		padding-top: 20upx;
    }

    .m-log-line {
		position: absolute;
		top: 26upx;
        width: 6upx;
        height: 37upx;
        margin-right: 42upx;
    }

    .m-log-info {
		display: flex;
		justify-content: space-between;
		align-items: center;
        width: 92%;
		margin-left: 40upx;
		padding-bottom: 20upx;
        border-bottom: 1px solid #e5e5e5;
    }

    .u-log-title {
        font-size: 32upx;
		color: #d71311;
    }

    .u-log-date {
        font-size: 24upx;
        color: #aaa;
    }

	.m-log-info-r{
	    font-size: 30upx;
		text-align: right;
	}
	.m-log-info-r .top{
	    font-size: 24upx;
	}
	.m-log-info-r .bottom{
	    font-size: 30upx;
	}
    
</style>
<template>
    <view>
        <view class="g-content-box">
            <view class="m-log">
                <view class="m-log-list" v-for="(item, index) in data" :key="index">
                    <view class="m-log-line red"></view>
                    <view class="m-log-info">
                        <view class="m-log-info-l">
                            <view class="u-log-title">{{item.is_accept == 1?'+':''}}{{item.money}}</view>
                            <view class="u-log-date">{{item.create_time}}</view>
                        </view>
                        <view class="m-log-info-r">
							<view class="bottom">{{item.is_accept_text}}</view>
							<view class="top">到账账户:{{item.account}}</view>
						</view>
                    </view>
                </view>
                <view class="m-b-loading" v-if="showLoading">
                    <image src="../../../static/images/loading2.gif" mode="widthFix"></image>
                    <text>加载中</text>
                </view>
			
            </view>
        </view>
        
		
        <view class="m-no-data" v-if="showNodata">
            <image src="../../../static/images/no_data.png" mode="widthFix"></image>
        </view>
    </view>
</template>

<script>
	import henglang from '@/common/common_zb.js';
    export default {
        data() {
            return {
                showLoading: false,
                showNodata: false,
				page: 1,
                data: [],
				total_pages:1
            };
        },
        methods: {
            request(type) {
				let that = this;
				if(that.page <= that.total_pages){
					that.showLoading = true;
					henglang.get('Maker/apply_list',{page:that.page},true,function(res){
						that.showLoading = false;
						if (res.data.data.length === 0) { 
							that.data = []
							that.showNodata = true;
						}else{
							that.showNodata = false;
							if (type == 'plus') {
								that.data = that.data.concat(res.data.data);
							} else {
								that.data = res.data.data;
								that.total_pages = res.data.total_pages;
							}
						}
					});
				}
            }
			
        },
        onReachBottom() {
			this.page ++
            this.request('plus');
        },
        onLoad() {
			this.request()
        }
    }
</script>
